package com.ecspace.knowledgegraphapi.controller;

import com.alibaba.fastjson.JSONObject;
import com.ecspace.knowledgegraphapi.domain.dto.DrawParams;
import com.ecspace.knowledgegraphapi.domain.vo.ResponseResult;
import com.ecspace.knowledgegraphapi.service.IDrawGraphService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: cs
 * @date: 2024-07-01 14:29:53
 * @since: 1.0
 */
@RestController
@RequestMapping("/graph")
public class GraphController {

    @Autowired
    private IDrawGraphService drawGraphService;

    @PostMapping("/draw")
    public ResponseResult<JSONObject> draw(@RequestBody DrawParams params) {

        JSONObject draw = drawGraphService.draw(params);
        return ResponseResult.success(draw);
    }





}
